using System;

namespace XmlObjects
{
	[AttributeUsage(AttributeTargets.Class, Inherited = true)]
	public class SuperClassAttribute : Attribute
	{
		public string AttributeName;
		public Type DefaultType = null;

		public SuperClassAttribute(string attributeName)
		{
			AttributeName = attributeName;
		}


		public SuperClassAttribute(string attributeName, Type defaultType)
		{
			AttributeName = attributeName;
			DefaultType = defaultType;
		}
	}

	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true, Inherited = true)]
	public class SubClassAttribute : Attribute
	{
		public Type SubClassType;
		public string Id;

		/// <summary>
		/// 
		/// </summary>
		/// <param name="subClassType">The type of a subclass of this</param>
		/// <param name="id"></param>
		public SubClassAttribute(Type subClassType, string id)
		{
			SubClassType = subClassType;
			Id = id;
		}

		public SubClassAttribute(Type subClassType)
		{
			SubClassType = subClassType;
		}
	}

	[AttributeUsage(AttributeTargets.Interface | AttributeTargets.Class | AttributeTargets.Property)]
	public class XmlElementAttribute : XmlMarkupAttribute
	{
		public Type ElementType = null;


		public XmlElementAttribute(string name, Type elementType) : base(name)
		{
			ElementType = elementType;
		}

		public XmlElementAttribute(string name) : base(name)
		{
		}

		public XmlElementAttribute(string name, string format) : base(name, format)
		{
		}

	}

	[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
	public class KeyAttribute :Attribute
	{
		public string Name;

		public KeyAttribute(string name)
		{
			Name = name;
		}
	}

	[AttributeUsage(AttributeTargets.Property)]
	public class XmlAttributeAttribute : XmlMarkupAttribute
	{
		public XmlAttributeAttribute(string name) : base(name)
		{
		}


		public XmlAttributeAttribute(string name, string format) : base(name, format)
		{
		}
	}

	public class XmlMarkupAttribute : Attribute
	{
		public string Name;
		public string Format;

		public XmlMarkupAttribute(string name)
		{
			Name = name;
		}

		public XmlMarkupAttribute(string name, string format)
		{
			Name = name;
			Format = format;
		}
	}
}